package com.rmy.queue.api;

import com.rmy.common.core.domain.R;
import com.rmy.queue.api.domain.UploadCallNumberReq;
import com.rmy.queue.api.domain.UploadTakeNumberReq;
import com.rmy.queue.domain.QmsMainCalledResp;
import com.rmy.queue.service.IQmsQueueListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 排队叫号外部接口
 */

@Api("综合屏服务接口")
@RestController
@RequestMapping("/queue/api")
public class QueueCallController {

    @Autowired
    private IQmsQueueListService qmsQueueListService;

    @ApiOperation("上送取号信息")
    @PostMapping("/uploadTakeQueueNo")
    public R uploadTakeQueueNo(@RequestBody UploadTakeNumberReq uploadTakeNumberReq)
    {
        int nRet = qmsQueueListService.uploadTakeNumberInfo(uploadTakeNumberReq);
        if (nRet <= 0) {
            return R.fail("上送取号信息出错");
        }
        return R.ok("上送取号成功");
    }

    @ApiOperation("上送叫号信息")
    @PostMapping("/uploadCallQueueNo")
    public R uploadCallQueueNo(@RequestBody UploadCallNumberReq uploadTakeNumberReq)
    {
        int nRet = qmsQueueListService.uploadCallNumberInfo(uploadTakeNumberReq);
        if (nRet <= 0) {
            return R.fail("上送叫号信息出错");
        }
        return R.ok("上送叫号成功");
    }

}
